// See https://aka.ms/new-console-template for more information
using DeviceCount;
using MiniExcelLibs;

Console.WriteLine("Hello, World!");
string path = @"E:\项目\13 数据\设备版本号.xlsx";

var rows = MiniExcel.Query<Device>(path).OrderByDescending(d=>d.Version);

Dictionary<string, int> dict = new Dictionary<string, int>();

foreach (var row in rows)
{
    if (dict.ContainsKey(row.Version))
    {
        dict[row.Version]++;
    }
    else
    {
        dict[row.Version] = 1;
    }
}

foreach(string ver in dict.Keys)
{
    Console.WriteLine($"{ver} : {dict[ver]}");
}

Console.ReadLine();

